package com.tencent.sr.iris.basic.saas.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 多任务活动对外状态 0：进行中，1：审核中，2：已完成 3：未完成
 */
@AllArgsConstructor
@Getter
public enum MultiTaskStatusEnum {
    
    PROGRESS(0, "进行中"),

    AUDITING(1, "审核中"),

    FINISHED(2, "已完成"),

    UNFINISHED(3, "未完成"),
    ;

    private final int code;

    private final String desc;

    public static MultiTaskStatusEnum getByCode(Integer code) {
        for (MultiTaskStatusEnum anEnum : MultiTaskStatusEnum.values()) {
            if (Objects.equals(anEnum.getCode(), code)) {
                return anEnum;
            }
        }
        return null;
    }
}
